# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2022-2025, Advanced Micro Devices, Inc.
#

ROOT := $(src)

ccflags-y += -I$(ROOT)/
# uAPI
ccflags-y += -I$(ROOT)/../../include/uapi
# version.h
ccflags-y += -I$(ROOT)/../../include

# All warning will report as error and debug build
ccflags-y += -g -Werror

obj-m	+= amdxdna.o
amdxdna-y := \
	amdxdna_ctx.o \
	amdxdna_drm.o \
	amdxdna_sysfs.o \
	amdxdna_mailbox.o \
	amdxdna_mailbox_helper.o \
	amdxdna_tdr.o \
	amdxdna_ubuf.o \
	amdxdna_carvedout_buf.o

amdxdna-$(OFT_CONFIG_AMDXDNA_PCI) += \
	amdxdna_gem.o \
	aie2_smu.o \
	aie2_psp.o \
	aie2_ctx.o \
	aie2_hwctx.o \
	aie2_error.o \
	aie2_debugfs.o \
	aie2_message.o \
	aie2_event_trace.o \
	aie2_ctx_runqueue.o \
	aie2_pm.o \
	aie2_pci.o \
	npu1_regs.o \
	npu2_regs.o \
	npu4_regs.o \
	npu5_regs.o \
	npu6_regs.o \
	amdxdna_pci_drv.o

amdxdna-$(OFT_CONFIG_AMDXDNA_OF) += \
	amdxdna_gem_of.o \
	ve2_of.o \
	ve2_regs.o \
	amdxdna_of_drv.o

# Helper functions for amdxdna development, but not for upstreaming
amdxdna-y += amdxdna_devel.o

-include $(src)/extra_drv.mk
